home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #42 (1995-01)(PackMAN)(DE)[WB].zip / Purity #42 (1995-01)(PackMAN)(DE)[WB].adf / Includes3v1 / Includes3v1.lha / Utils / CRC16.i < prev    next >
Text File  |  1994-12-04  |  1KB  |  37 lines

  1. {
  2.     CRC16.p
  3.  
  4.     Routines for calculating 16-bit CRC values.
  5. }
  6.  
  7. {
  8.  * UpdCRC derived from article Copyright (C) 1986 Stephen Satchell.
  9.  *  NOTE: First argument must be in range 0 to 255.
  10.  *        Second argument is referenced twice.
  11.  *
  12.  * Programmers may incorporate any or all code into their programs,
  13.  * giving proper credit within the source. Publication of the
  14.  * source routines is permitted so long as proper credit is given
  15.  * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
  16.  * Omen Technology.
  17.  
  18.     UpdCRC uses the fast table-driven method to calculate CRCs.
  19.     You pass in the next byte as "cp", plus the previous CRC value
  20.     as "crc".  The function returns the new crc value.  "crc" should
  21.     be initialized to 0 before calculating CRCs, by the way.
  22. }
  23.  
  24. Function UpdCRC(cp : Byte; crc : Short) : Short;
  25.     External;
  26.  
  27. {
  28.     CRCCheck uses the UpdCRC function to calculate the CRC of
  29.     an entire buffer at once.  You pass in the Buffer address
  30.     and the number of characters you want to use, and this
  31.     function returns the CRC value.
  32. }
  33.  
  34. Function CRCCheck(Buffer : Address; Length : Integer) : Short;
  35.     External;
  36.  
  37.